package com.hs.service;

import com.hs.dao.ClassLessonIssueMapper;
import com.hs.dao.IssueFlushMapper;
import com.hs.entity.ClassLessonIssue;
import com.hs.entity.IssueFlush;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
public class IssueFlushService {

    @Autowired
    IssueFlushMapper issueFlushMapper;
    @Transactional
    public int insertSelective(IssueFlush record){
        record.setCreateTime(new Date());
        int i = issueFlushMapper.insertSelective(record);
        if(i == 0){
            throw new RuntimeException("用户插入失败");
        }
        //初始化用户的物品持有列表
        return  i;
    };
    public List<IssueFlush> selectByCondition(IssueFlush record){
        return issueFlushMapper.selectByCondition(record);
    }


}
